import request from '@/utils/api'
import qs from 'qs'

export function login(data) {
    return request({
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: `/login`,
        data: qs.stringify(data)
    })
}

export function logout() {
    return request({
        url: '/logout',
        method: 'post'
    })
}


export function getInfo() {
    return request({
        url: '/api/getUserInfo',
        method: 'get'
    })
}



export function getChartData(){
    return request({
        url: '/api/getChartData',
        method: 'get'
    })
}


// 上传图片
/*
export function uploadImg(file) {
  const formData = new FormData() // 创建form对象
  formData.append('file', file, file.name) // 通过append向form对象添加数据
  return request({
    url: '/a/imgupload',
    method: 'post',
    data: formData
  })
}
*/
